// updateOrganizationActivityOrder
exports.updateOrganizationActivityOrder = function (req, res) {

    var bodyParams = req.routeInfo.bodyParams;
    //最终结果
    var resultData = {};

    var orderInfo = bodyParams.orderInfo;
    //任务流创建
    async.waterfall([
            function (cb) {

                var tasks = [];

                orderInfo.forEach(function (item, i) {

                    tasks.push(function (cb) {

                        if (item.length !== 0) {
                            R.SEND_HTTP(
                                req,
                                {
                                    url: CORE_APIConfig.coreAPI.updateOrganizationActivity,
                                    method: 'POST',
                                    data: {
                                        oa_id:item.oa_id,
                                        oa_order:item.oa_order,
                                    }
                                },
                                function (err, data) {

                                    console.log("updateInfo:"+item.oa_id+"->");
                                    console.log(data);
                                    if(err){
                                        RES.response(res, false, data);
                                    }
                                    resultData.updateData = data;
                                    cb();
                                }
                            );
                        }
                    });
                });
                async.waterfall(tasks, cb);
            },
        ], function (err, result) {

            //返回最终拼接结果
            RES.response(res, true, resultData);

        }
    );

}